package com.ankicoo.auth.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;
import java.util.Map;

/**
 * Description: 自定义过滤策略
 *
 * @author : QCYANG
 * @date : 2021/1/20 20:33
 */
@Configuration
@ConfigurationProperties(prefix = "shiro.auth")
public class ShiroFilterConfiguration {
    private Map<String, List<String>> shiroFilterDefinition;
    private ShiroUrlDefinition shiroUrlDefinition;

    public Map<String, List<String>> getShiroFilterDefinition() {
        return shiroFilterDefinition;
    }

    public void setShiroFilterDefinition(Map<String, List<String>> shiroFilterDefinition) {
        this.shiroFilterDefinition = shiroFilterDefinition;
    }


    public ShiroUrlDefinition getShiroUrlDefinition() {
        return shiroUrlDefinition;
    }

    public void setShiroUrlDefinition(ShiroUrlDefinition shiroUrlDefinition) {
        this.shiroUrlDefinition = shiroUrlDefinition;
    }

    static class ShiroUrlDefinition{
        String loginUrl;
        String unauthorizedUrl;

        public String getLoginUrl() {
            return loginUrl;
        }

        public void setLoginUrl(String loginUrl) {
            this.loginUrl = loginUrl;
        }

        public String getUnauthorizedUrl() {
            return unauthorizedUrl;
        }

        public void setUnauthorizedUrl(String unauthorizedUrl) {
            this.unauthorizedUrl = unauthorizedUrl;
        }
    }
}
